#pragma once
#ifndef OBLIVION

#include "ARES.rc.h"
#include "GridControl/GridCtrl.h"
#include "GridControl/GridCellCheck.h"
#include "afxcmn.h"
#include "afxwin.h"
#include "afxdialogex.h"

class AffixFilter;
class MagicItemGenerator;

class CFilterTab;


// CAffixFilterDlg dialog

class CAffixFilterDlg : public CDialog
{
	DECLARE_DYNAMIC(CAffixFilterDlg)

public:
	CAffixFilterDlg(CWnd* pParent = NULL);   // standard constructor
	virtual ~CAffixFilterDlg();

// Dialog Data
	enum { IDD = IDD_FLTDLG };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	// MFCGridCtrl for the list of MIGs.
	CListCtrl CFltList;
	CEdit CEditorID;
	CString EDID;
	bool mod;
	BOOL app;
	BOOL arm;
	BOOL wep;
	CGridCtrl CMigGrid;
	AffixFilter* currPtr;
	
	CTabCtrl CFilterTabs;
	int currTab;
	static const int pageCt = 3;
	CFilterTab* tabs[pageCt];
	
	CButton CApply;
	
	void dlgMod(bool new_mod, bool force = false);
	bool dlgNew();
	bool dlgSave();
	bool dlgConfirm();
	bool dlgEdit(POINT pt);
	bool dlgEdit(int item);
	bool dlgDelete(POINT pt);
	bool dlgDelete(int item);
	
	void ShowTab(int i);
	
	virtual BOOL OnInitDialog();
	afx_msg void OnModify();
	afx_msg void OnLvnGetdispinfoFltlist(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnBnClickedApply();
	afx_msg void OnBnClickedOk();
	afx_msg void OnBnClickedCancel();
	afx_msg void OnClose();
	afx_msg void OnDestroy();
	virtual void PostNcDestroy();
	afx_msg void OnNMDblclkFltlist(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMGridModifiedMig(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMRClickFltlist(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLvnKeydownFltlist(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnBnClickedImport();
	afx_msg void OnTcnSelchangeTabs(NMHDR *pNMHDR, LRESULT *pResult);
};

#endif
